<template>
<view class="addCart flex a-item j-content" @tap="addCart">
  <span v-if="type!=='3' && type!=='5'">添加到购物车</span>
  <span v-else>确认</span>
</view>
</template>

<script>
export default {
  name: "addShoppingCart",
  props:{
    type:{
      type:String,
      default:'1'
    },},
  methods:{
    addCart() {
      if(this.type !=='3' && this.type !=='5'){
      this.$emit('add')
      }else{
        this.$emit('submit')
      }

    }
  }
}
</script>

<style scoped>
.addCart{
  width: 700rpx;
  left: 25rpx;
  height: 100rpx;
  background: red;
  border-radius: 100rpx;
  color: #ffffff;
  font-size: 40rpx;
  position: absolute;
  bottom: 30rpx;
  z-index: 99;
}
</style>
